Ten unit cubes are glued together as shown.   How many square units are in the surface area of the resulting solid?

[asy]
draw((0,0)--(30,0)--(30,10)--(0,10)--cycle);
draw((10,0)--(10,10));
draw((20,0)--(20,10));
draw((5,15)--(35,15));
draw((0,10)--(5,15));
draw((10,10)--(15,15));
draw((20,10)--(25,15));
draw((35,15)--(35,5)--(30,0));
draw((30,10)--(35,15));
draw((-7,0)--(33,0)--(33,-10)--(-7,-10)--cycle);
draw((-7,0)--(-2,5)--(0,5));
draw((3,-10)--(3,0));
draw((13,-10)--(13,0));
draw((23,-10)--(23,0));
draw((35,5)--(38,5)--(33,0));
draw((38,5)--(38,-5)--(33,-10));
draw((2,-10)--(2,-20)--(32,-20)--(32,-10)--cycle);
draw((12,-10)--(12,-20));
draw((22,-10)--(22,-20));
draw((32,-20)--(37,-15)--(37,-6));
[/asy]
There are 10 cubes, thus, there are 10 sq. units in each of the faces facing towards us and away from us.  The figure has a height of 3, so there 6 sq. units total in each of the vertical sides.  And the figure has a total width of 4 cubes, so despite the fact that there is overlap, there is still a horizontal width of 4, making for 4 sq. units in each of the horizontal sides, making 8 total sq. units.  Thus, there is a total of $10 + 10 + 8 + 6 = \boxed{34\text{ sq. units}}$.